package Chat.Donnees;

import java.io.Serializable;

/**
 * Format d'un Contact
 *
 * @author Ndanja & Papa Abdou
 */
public class Contact implements Serializable {

    private String nickname;
    private String address;

    /**
     *
     * @param nickname: L'identifiant du contact
     * @param address: l'adresse du Contact
     */
    public Contact(String nickname, String address) {
        this.nickname = nickname;
        this.address = address;
    }

    /**
     * Retourne le "nickname" du contact
     * @return String
     */
    public String getNickname() {
        return this.nickname;
    }

    /**
     * Retourne l'adresse IP du contact
     * @return String
     */
    public String getAddress() {
        return this.address;
    }

    /**
     * Permet de modifier le nickname du Contact
     * @param nickname
     */
    public void setNickname(String nickname) {
        this.nickname = nickname;
    }

    /**
     * Permet de modifier l'adresse IP du Contact
     * @param address
     */
    public void setAddress(String address) {
        this.address = address;
    }

    @Override
    public String toString() {
        String s = new String();
        s = this.getNickname() + ":" + this.getAddress();

        return s;
    }
}

